{extend name=".././view/create.html" /}
{block name="jscss"}
<style type="text/css">
  .srcSelectStyly{
    /*margin-top:20px;*/
    border-width: 1px;
    border-color:#e2e2e2;
    border-style:solid;
    background-color:#ffffff;
    position:absolute;
    left:0;
    right:0;
    z-index:100;
  }
  .srcSelectStyly dl{
    padding-top: 3px;
    padding-left: 6px;
    background-color:#ffffff;
  }
  .srcSelectStyly dd{
    /*margin-bottom: 3px;*/
    /*background-color:#f2f2f2;*/
    height: 30px;
    padding-top: 10px;
  }
</style>
{/block}
{block name="form"}
    <form class="layui-form layui-form-pane" lay-filter="myform">
          <div class="layui-form-item">
              <label for="xingming" class="layui-form-label">
                  <span class="x-red">*</span>用户姓名
              </label>
              <div class="layui-input-block">
                  <input type="text" id="xingming" name="xingming" lay-verify="required"
                  autocomplete="off" class="layui-input " value="{$list.data.xingming|default=''}" placeholder="中文2-25个字符">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  <span class="x-red">*</span>帐号
              </label>
              <div class="layui-input-block">
                  <input type="text" id="username" name="username" lay-verify="required"
                  autocomplete="off" class="layui-input" value="{$list.data.username|default=''}" placeholder="由字母、数字-_组成 6-12个字符"
                  {eq name="$list.set.formpost" value="PUT" }
                     disabled
                  {/eq}>
              </div>
          </div>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  教师编号
              </label>
              <div class="layui-input-block">
                  <input style="max-width: 300px;" type="text" id="teacher_id" name="teacher_id" autocomplete="off" class="layui-input" value="{$list.data.teacher_id|default=''}" placeholder="请输入姓名、姓名的全拼或简拼查询教师" >
              </div>
          </div>
          <div class="layui-form-item">
            <label for="school_id" class="layui-form-label"><span class="x-red">*</span>所在单位</label>
            <div class="layui-input-block">
              {php} $schlist = danweiJibie('校级', '区级');{/php}
              <select name="school_id" lay-verify="required">
                <option value=""></option>
                {volist name="schlist" id="vo"}
                  <option value="{$vo.id}"
                  {present name="$list.data.school_id"}
                    {eq name="$list.data.school_id" value="$vo.id" }
                      selected
                    {/eq}
                  {/present}>
                    {$vo.title}
                  </option>
                {/volist}
              </select>
            </div>
          </div>
          <div class="layui-form-item">
            <label for="group_id" class="layui-form-label"><span class="x-red">*</span>角色设置</label>
            <div class="layui-input-block">
              {php}
                $authgroup = new \app\admin\model\AuthGroup;
                $authgrouplist = $authgroup->where('status',1)->select();
              {/php}
                {volist name="authgrouplist" id="vo"}
                <input type="checkbox" name="group_id[]" title="{$vo.title}" value="{$vo.id}" lay-skin="primary" {present name="$list.data.gl_group"}
                    {volist name="list.data.gl_group" id="va"}
                      {eq name="$va.title" value="$vo.title"}checked{/eq}
                    {/volist}
                  {/present}>
                {/volist}
              </select>
            </div>
          </div>
          <div class="layui-form-item">
              <label for="shengri" class="layui-form-label">
                  <span class="x-red">*</span>出生日期
              </label>
              <div class="layui-input-block">
                  <input type="text" class="layui-input" id="shengri" name="shengri" lay-verify="required" autocomplete="off" value="{$list.data.shengri|default=''}" placeholder="日期格式">
              </div>
          </div>
          <div class="layui-form-item" pane>
            <label for="sex" class="layui-form-label"><span class="x-red">*</span>性别</label>
            <div class="layui-input-block">
              <input type="radio" name="sex" value="1" title="男"
                {present name="$list.data.sex"}
                {$list.data.sex}
                    {eq name="$list.data.sex" value="男" }
                     checked
                    {/eq}
                {/present}>
              <input type="radio" name="sex" value="0" title="女"
                {present name="$list.data.sex"}
                    {eq name="list.data.sex" value="女" }
                     checked
                    {/eq}
                {/present}
                {notpresent name="$list.data.sex"}
                 checked
                {/notpresent}
                >
            </div>
          </div>
          <div class="layui-form-item">
              <label for="phone" class="layui-form-label">
                  电话号码
              </label>
              <div class="layui-input-block">
                  <input type="input" id="phone" name="phone" lay-verify=""
                  autocomplete="off" class="layui-input" value="{$list.data.phone|default=''}" placeholder="数字">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="beizhu" class="layui-form-label">
                  备注
              </label>
              <div class="layui-input-block">
                  <input type="input" id="beizhu" name="beizhu" lay-verify=""
                  autocomplete="off" class="layui-input" value="" placeholder="">
              </div>
          </div>
          <div class="layui-form-item" style="text-align: right;">
              <button  class="layui-btn" lay-filter="mysubmit" lay-submit="">
                  {$list.set.butname}
              </button>
          </div>
      </form>
{/block}

{block name="myjs"}
<script>
    layui.use('laydate', function(){
      var laydate = layui.laydate;
      //开始时间
      laydate.render({
        elem: '#shengri'
        ,type: 'datetime'
        ,trigger: 'click' //采用click弹出
        ,format: 'yyyy-M-d' //可任意组合
      });
    });

    var cjgl = parent.layui.cjgl;
    // 搜索教师
    $('#teacher_id').bind({
      keyup:function(){
        var val = $.trim($(this).val());
        cjgl.searchTeacher(this, val, 'teacher_id', 'addTeacherID');
      },
    });
</script>
{/block}

